﻿@model SimplCommerce.Module.Contacts.ViewModels.ContactVm
@inject IConfiguration Config

@{
    ViewData["Title"] = "Contact Us";
}
<div class="row">
    <div class="col-md-6">
        <div class="col-md-12">
            <h3 class="page-header">@Localizer["Contact Us"]</h3>
        </div>
        <div class="col-md-12">
            <form class="form-horizontal" action="/contact" method="POST">
                <div class="form-group">
                    <div class="col-sm-6">
                        <input asp-for="FullName" class="form-control input-contact" type="text" placeholder="@Localizer["Full name"]" />
                        <span asp-validation-for="FullName" class="text-danger"></span>
                    </div>
                    <div class="col-sm-6">
                        <input asp-for="PhoneNumber" class="form-control input-contact" type="text" placeholder="@Localizer["Phone number"]" />
                        <span asp-validation-for="PhoneNumber" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12">
                        <input asp-for="EmailAddress" class="form-control input-contact" type="email" placeholder="@Localizer["Email"]" />
                        <span asp-validation-for="EmailAddress" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12">
                        <input asp-for="Address" type="text" class="form-control input-contact" placeholder="@Localizer["Address"]">
                        <span asp-validation-for="Address" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12">
                        <select class="form-control input-contact" asp-for="ContactAreaId">
                            @foreach (var item in Model.ContactAreas)
                            {
                                <option value="@item.Id"> @item.Name </option>
                            }
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12">
                        <textarea class="form-control input-contact" rows="5" asp-for="Content"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-4">
                        <button type="submit" class="btn btn-success">@Localizer["Submit"]</button>
                    </div>
                </div>
            </form>

        </div>
    </div>
    <div class="col-md-6" id="googleMap">

    </div>

</div>
@section scripts {
    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
    <script simpl-append-version="true" src="~/modules/contacts/init-google-map.js"></script>
    <script async defer src="https://maps.googleapis.com/maps/api/js?key=@Config["GoogleAppKey"]&callback=initMap"> </script>
}